package megrez.job.custom.domain;

/**
 * 任务状态
 *  
 * @author Lucky Yang
 * @since 2.6.9
 */
public enum TaskState {
    STARTED("启动"),
    RUNNING("运行中"),
    ERROR("运行异常"),
    COMPLETE("运行完成"),
    STOPPED("停止");

    public final String note;

    private TaskState(String note) {
        this.note = note;
    }

    public boolean started() {
        return this.equals(STARTED);
    }

    public boolean running() {
        return this.equals(RUNNING);
    }

    public boolean error() {
        return this.equals(ERROR);
    }

    public boolean complete() {
        return this.equals(COMPLETE);
    }

    public boolean stopped() {
        return this.equals(STOPPED);
    }
}
